import request from '@/utils/request'

// 获取系统概览数据
export function getSystemOverview() {
  return request({
    url: '/dashboard/overview',
    method: 'get'
  })
}

// 保存证书模板
export function saveCertificateTemplate(data) {
  return request({
    url: '/dashboard/certificate/save',
    method: 'post',
    data
  })
}

export function previewCertificateTemplate(data) {
  return request({
    url: '/dashboard/certificate/preview',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

export function getTemplatesByCreator(creatorId) {
  return request({
    url: `/dashboard/certificate/template/list`,
    method: 'get',
    params: { creatorId }
  })
}

export function deleteTemplate(templateId) {
  return request({
    url: `/dashboard/certificate/template/${templateId}`,
    method: 'delete'
  })
}

export function getTemplatePreview(templateId) {
  return request({
    url: `/dashboard/certificate/template/preview/${templateId}`,
    method: 'get',
    responseType: 'blob'
  })
} 